package frmMantenimiento;

import cls.conexion;
import com.sun.glass.events.KeyEvent;
import frm.frmPrincipal;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

// se realiza la conexion y se inicia los componentes
public class frmImpuesto extends javax.swing.JFrame {

    static conexion CP; // conexion con base de datos

    public frmImpuesto() throws ClassNotFoundException, SQLException {
        initComponents();
        
        setLocationRelativeTo(null);
        noVer();
        CP = new conexion("proyecto2", "usrUTN", "12345");
        verdatos();
    }

    // metodo ver datos de la base de datos hacia la tabla de la ventana
    private void verdatos() {

        DefaultTableModel modelo = (DefaultTableModel) tblimpuesto.getModel();
        Object[] fila = new Object[8];
        modelo.setRowCount(0);

        try {
            ResultSet datos = this.CP.select("*", "\"schUTN\".impuesto", "");
            while (datos.next()) {
                fila[0] = datos.getString(1);
                fila[1] = datos.getString(2);
                fila[2] = datos.getString(3);
                fila[3] = datos.getString(4);

                modelo.addRow(fila);

            }
        } catch (Exception e) {
            System.out.printf("Error: " + e.toString());
        }

    }

    private void limpiarRd() {
        rdNo.setSelected(false);
        rdSi.setSelected(false);
        rdNo.setEnabled(true);
        rdSi.setEnabled(true);
    }

    // ocultamos los botones
    private void noVer() {
        jLabel1.setVisible(false);
        jLabel2.setVisible(false);
        jLabel3.setVisible(false);
        jLabel4.setVisible(false);
        txtCodigo.setVisible(false);
        txtDesc.setVisible(false);
        txtPorcentaje.setVisible(false);
        rdNo.setVisible(false);
        rdSi.setVisible(false);
        btnFinalizarModificar.setVisible(false);
        btnFinalizarinsertar.setVisible(false);
    }

    // hacemos visibles los botones y etiquetas
    public void ver() {
        jLabel1.setVisible(true);
        jLabel2.setVisible(true);
        jLabel3.setVisible(true);
        jLabel4.setVisible(true);
        txtCodigo.setVisible(true);
        txtDesc.setVisible(true);
        txtPorcentaje.setVisible(true);
        rdSi.setVisible(true);
        rdNo.setVisible(true);
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        tblimpuesto = new javax.swing.JTable();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        btnAtras = new javax.swing.JButton();
        btnInaertar = new javax.swing.JButton();
        btnmodificar = new javax.swing.JButton();
        btnEliminar = new javax.swing.JButton();
        txtCodigo = new javax.swing.JTextField();
        txtDesc = new javax.swing.JTextField();
        txtPorcentaje = new javax.swing.JTextField();
        btnFinalizarinsertar = new javax.swing.JButton();
        btnFinalizarModificar = new javax.swing.JButton();
        rdSi = new javax.swing.JRadioButton();
        rdNo = new javax.swing.JRadioButton();
        mnAtras = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("IMPUESTO");
        addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                formKeyPressed(evt);
            }
        });

        tblimpuesto.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Codigo", "Descripcion", "Porcentaje", "Activo"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tblimpuesto.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblimpuestoMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(tblimpuesto);
        if (tblimpuesto.getColumnModel().getColumnCount() > 0) {
            tblimpuesto.getColumnModel().getColumn(0).setResizable(false);
            tblimpuesto.getColumnModel().getColumn(1).setResizable(false);
            tblimpuesto.getColumnModel().getColumn(2).setResizable(false);
            tblimpuesto.getColumnModel().getColumn(3).setResizable(false);
        }

        jLabel1.setText("Codigo");

        jLabel2.setText("Descripcion");

        jLabel3.setText("Procentaje");

        jLabel4.setText("Activo");

        btnAtras.setText("Atras");
        btnAtras.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAtrasActionPerformed(evt);
            }
        });

        btnInaertar.setText("Insertar");
        btnInaertar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnInaertarActionPerformed(evt);
            }
        });

        btnmodificar.setText("Modificar");
        btnmodificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnmodificarActionPerformed(evt);
            }
        });

        btnEliminar.setText("eliminar");
        btnEliminar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEliminarActionPerformed(evt);
            }
        });

        txtPorcentaje.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                txtPorcentajeFocusLost(evt);
            }
        });

        btnFinalizarinsertar.setText("Finalizar");
        btnFinalizarinsertar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFinalizarinsertarActionPerformed(evt);
            }
        });

        btnFinalizarModificar.setText("Finalizar");
        btnFinalizarModificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFinalizarModificarActionPerformed(evt);
            }
        });

        rdSi.setText("SI");
        rdSi.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                rdSiMouseClicked(evt);
            }
        });
        rdSi.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                rdSiItemStateChanged(evt);
            }
        });
        rdSi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdSiActionPerformed(evt);
            }
        });
        rdSi.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                rdSiFocusLost(evt);
            }
        });

        rdNo.setText("No");
        rdNo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdNoActionPerformed(evt);
            }
        });
        rdNo.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                rdNoFocusLost(evt);
            }
        });

        mnAtras.add(jMenu1);

        jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem1);

        mnAtras.add(jMenu2);

        setJMenuBar(mnAtras);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(12, 12, 12)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addComponent(txtCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(27, 27, 27)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2)
                            .addComponent(txtDesc, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(27, 27, 27)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(txtPorcentaje, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(37, 37, 37)
                                .addComponent(jLabel4))
                            .addGroup(layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(rdSi)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(rdNo))))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(btnInaertar)
                        .addGap(18, 18, 18)
                        .addComponent(btnmodificar)
                        .addGap(18, 18, 18)
                        .addComponent(btnEliminar)
                        .addGap(43, 43, 43)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnFinalizarinsertar)
                            .addComponent(btnFinalizarModificar)))))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                .addComponent(btnAtras, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 420, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(1, 1, 1)
                        .addComponent(txtCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addGap(3, 3, 3)
                        .addComponent(txtDesc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addGap(3, 3, 3)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtPorcentaje, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(rdSi)
                            .addComponent(rdNo)))
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel4)))
                .addGap(22, 22, 22)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnInaertar)
                    .addComponent(btnmodificar)
                    .addComponent(btnEliminar)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnFinalizarinsertar)
                            .addComponent(btnFinalizarModificar))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
                .addComponent(btnAtras))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    // boton insert
    private void btnInaertarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInaertarActionPerformed
        ver();
        btnFinalizarinsertar.setVisible(true);
        this.txtCodigo.requestFocus();
    }//GEN-LAST:event_btnInaertarActionPerformed

    // boton que finaliza el insert
    private void btnFinalizarinsertarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFinalizarinsertarActionPerformed
        try {
            if (!(this.txtCodigo.getText().charAt(0) == ' ')) {
                try {
                    String si = "";
                    if (rdSi.isSelected()) {
                        si = "S";
                    } else {
                        if (rdNo.isSelected()) {
                            si = "N";
                        }
                    }
                    boolean resultado = this.CP.insert("\"schUTN\".impuesto",
                            "(" + "'" + this.txtCodigo.getText() + "'"
                            + ", " + "'" + this.txtDesc.getText() + "', "
                            + txtPorcentaje.getText() + ", "
                            + "'" + si + "' " + ");");
                } catch (Exception e) {
                    System.out.printf("Error: " + e.toString());
                }
                limpiar();
                int validar = JOptionPane.showConfirmDialog(
                        null,
                        "Deseas Realizar Otra operacion",
                        "  ",
                        JOptionPane.YES_NO_OPTION);
                if (validar == JOptionPane.YES_OPTION) {
                    verdatos();
                    limpiar();
                } else {
                    verdatos();

                    noVer();
                }
            }
        } catch (Exception e) {
            JOptionPane.showMessageDialog(null, "Codigo Obligatorio");
        }

        limpiarRd();


    }//GEN-LAST:event_btnFinalizarinsertarActionPerformed

    // boton modificar
    private void btnmodificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnmodificarActionPerformed
        noVer();
        ver();
        btnFinalizarModificar.setVisible(true);
        this.txtCodigo.requestFocus();
    }//GEN-LAST:event_btnmodificarActionPerformed

    // boton que finaliza la modificacion 
    private void btnFinalizarModificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFinalizarModificarActionPerformed

        String cod;
        DefaultTableModel modelo = (DefaultTableModel) tblimpuesto.getModel();
        int vector[] = tblimpuesto.getSelectedRows();
        int in = tblimpuesto.getSelectedRow();
        if (in == -1) {
            JOptionPane.showMessageDialog(null, "Selecione un valor valido");
        } else {
            for (int i = 0; i < vector.length; i++) {
                cod = (String) tblimpuesto.getValueAt(in, 0);
                try {
                    String si = "";
                    if (rdSi.isSelected()) {
                        si = "S";
                    } else {
                        if (rdNo.isSelected()) {
                            si = "N";
                        }
                    }
                    boolean resultado = this.CP.actualizar("\"schUTN\".impuesto",
                            " cod_impuesto= " + "'" + this.txtCodigo.getText() + "'"
                            + ", " + " descripcion= " + " '" + this.txtDesc.getText() + "' , "
                            + "porcentaje=" + txtPorcentaje.getText() + ", "
                            + " activo= " + "'" + si + "' ", "cod_impuesto= " + "'" + cod + "'");
                } catch (Exception e) {
                    System.out.printf("Error: " + e.toString());
                }
            }
        }

        limpiarRd();

        verdatos();
        noVer();
    }//GEN-LAST:event_btnFinalizarModificarActionPerformed

    // boton eliminar
    private void btnEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarActionPerformed
        noVer();
        int validar = JOptionPane.showConfirmDialog(
                null,
                "Estas Seguro?",
                " CUIDADO",
                JOptionPane.YES_NO_OPTION);
        if (validar == JOptionPane.YES_OPTION) {
            try {
                boolean resultado = this.CP.eliminar("\"schUTN\".impuesto",
                        "cod_impuesto= " + "'" + this.txtCodigo.getText() + "'");
            } catch (Exception e) {
                System.out.printf("Error: " + e.toString());
            }
            verdatos();
        } else {
            verdatos();
        }
    }//GEN-LAST:event_btnEliminarActionPerformed

    // boton que regresa hacia la ventana principal
    private void btnAtrasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAtrasActionPerformed
        setVisible(false);
        frmPrincipal o = new frmPrincipal();
        o.setVisible(true);
    }//GEN-LAST:event_btnAtrasActionPerformed

    // evento del mause para señalar los datos de la tabla en los txt field
    private void tblimpuestoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblimpuestoMouseClicked
limpiarRd();
        String cod;
        DefaultTableModel modelo = (DefaultTableModel) tblimpuesto.getModel();
        int vector[] = tblimpuesto.getSelectedRows();
        int in = tblimpuesto.getSelectedRow();

        cod = (String) tblimpuesto.getValueAt(in, 0);
        txtCodigo.setText(cod);

        cod = (String) tblimpuesto.getValueAt(in, 1);
        txtDesc.setText(cod);

        cod = (String) tblimpuesto.getValueAt(in, 2);
        txtPorcentaje.setText(cod);
        
        
        cod = (String) tblimpuesto.getValueAt(in, 3);
        if (cod.equals("S")) {
            rdSi.setSelected(true);

        } else {
            rdNo.setSelected(true);
        }

        if (rdSi.isSelected()) {
            rdNo.setEnabled(false);
        } else {
            rdNo.setEnabled(true);
        }

        if (rdNo.isSelected()) {
            rdSi.setEnabled(false);

        } else {
            rdSi.setEnabled(true);
        }
        
    }//GEN-LAST:event_tblimpuestoMouseClicked

    private void rdSiMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_rdSiMouseClicked

    }//GEN-LAST:event_rdSiMouseClicked

    private void rdSiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdSiActionPerformed
        if (rdSi.isSelected()==true) {
            rdNo.setEnabled(false);
                  if(this.btnFinalizarModificar.isEnabled()==true)
           {
               this.btnFinalizarModificar.requestFocus();
           }
          
           
               if (this.btnFinalizarinsertar.isEnabled()==true) {
                   
                   this.btnFinalizarinsertar.requestFocus();
               }
               
        } else {
            rdNo.setEnabled(true);
        }
    }//GEN-LAST:event_rdSiActionPerformed

    private void rdSiItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_rdSiItemStateChanged


    }//GEN-LAST:event_rdSiItemStateChanged

    private void rdNoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdNoActionPerformed
        if (rdNo.isSelected()) {
            rdSi.setEnabled(false);
                  if(this.btnFinalizarModificar.isEnabled()==true)
           {
               this.btnFinalizarModificar.requestFocus();
           }
          
           
               if (this.btnFinalizarinsertar.isEnabled()==true) {
                   
                   this.btnFinalizarinsertar.requestFocus();
               }
               
        } else {
            rdSi.setEnabled(true);
        }
    }//GEN-LAST:event_rdNoActionPerformed

    private void txtPorcentajeFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtPorcentajeFocusLost
       if (rdSi.isSelected()==false && rdNo.isSelected()==false) {
            this.rdSi.requestFocus();
        }else{
            if (rdSi.isSelected()==true) {
                rdSi.requestFocus();
            }else{
                rdNo.requestFocus();
            }
        }
        
        
    }//GEN-LAST:event_txtPorcentajeFocusLost

    private void rdSiFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_rdSiFocusLost
        // TODO add your handling code here:
        
         if (rdSi.isSelected()==true) {
            rdNo.setEnabled(false);
                  if(this.btnFinalizarModificar.isEnabled()==true)
           {
               this.btnFinalizarModificar.requestFocus();
           }
          
           
               if (this.btnFinalizarinsertar.isEnabled()==true) {
                   
                   this.btnFinalizarinsertar.requestFocus();
               }
               
        } else {
            rdNo.setEnabled(true);
        }
    }//GEN-LAST:event_rdSiFocusLost

    private void rdNoFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_rdNoFocusLost
        // TODO add your handling code here:
           if (rdNo.isSelected()==true) {
            rdSi.setEnabled(false);
                  if(this.btnFinalizarModificar.isEnabled()==true)
           {
               this.btnFinalizarModificar.requestFocus();
           }
          
           
               if (this.btnFinalizarinsertar.isEnabled()==true) {
                   
                   this.btnFinalizarinsertar.requestFocus();
               }
               
        } else {
            rdSi.setEnabled(true);
        }
           
           if(rdNo.isSelected()==false&&rdSi.isSelected()==false)
       {
           this.rdSi.requestFocus();
       }
    }//GEN-LAST:event_rdNoFocusLost

    private void formKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_formKeyPressed
        // TODO add your handling code here:
          char tecla=evt.getKeyChar();
        if(tecla==KeyEvent.VK_ESCAPE)
        {
            setVisible(false);
            frmPrincipal F = new frmPrincipal();
            F.setVisible(true);
          
            
        }
    }//GEN-LAST:event_formKeyPressed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        // TODO add your handling code here:
        setVisible(false);
        new frmPrincipal().setVisible(true);
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    // metodo que se usa para limpar los campos usados 
    public void limpiar() {
        txtCodigo.setText("");
        txtDesc.setText("");
        txtPorcentaje.setText("");
    }

    // metodo main creado por JAVA
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    new frmImpuesto().setVisible(true);
                } catch (ClassNotFoundException | SQLException ex) {
                    Logger.getLogger(frmImpuesto.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAtras;
    private javax.swing.JButton btnEliminar;
    private javax.swing.JButton btnFinalizarModificar;
    private javax.swing.JButton btnFinalizarinsertar;
    private javax.swing.JButton btnInaertar;
    private javax.swing.JButton btnmodificar;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JMenuBar mnAtras;
    private javax.swing.JRadioButton rdNo;
    private javax.swing.JRadioButton rdSi;
    private javax.swing.JTable tblimpuesto;
    private javax.swing.JTextField txtCodigo;
    private javax.swing.JTextField txtDesc;
    private javax.swing.JTextField txtPorcentaje;
    // End of variables declaration//GEN-END:variables
}
